package rnd;

import java.util.Random;

public class VTM {

	private static final Random rnd = new Random();
	private static final  int tries = 10000000;

	public static void main(String[] args) {

		for (int difficulty = 2; difficulty < 10; difficulty++) {
			for (int dice = 1; dice < 11; dice++) {
				int successfulTries = 0;

				for (int i = 0; i < tries; i++) {
					int successes = 0;

					for (int j = 0; j < dice; j++) {
						int die = d10();

						if (die == 1) {
							successes--;
						} else if (die == 10) {
							successes++;
							successes++;
						} else if (die >= difficulty) {
							successes++;
						}
					}

					if (successes > 0) {
						successfulTries++;
					}
				}

				System.out.println(difficulty + "\t" + dice + "\t" + (float)successfulTries/tries*100);
			}
		}

	}

	private static int d10() {
		return rnd.nextInt(10) + 1;
	}

}
